package cytj.setup.bean;

/**
 * 蓝牙接收到的协议数据的实体类
 * Created by LTP on 2015/12/28
 */
public class Data implements Comparable<Data> {
    private String time;
    private String dataContent;

    public Data(String dataContent, String time) {
        this.dataContent = dataContent;
        this.time = time;
    }

    /**
     * 获取协议发送的时间
     *
     * @return 协议发送的时间
     */
    public String getTime() {
        return time;
    }

    /**
     * 获取协议发送的内容
     *
     * @return 协议发送的内容
     */
    public String getDataContent() {
        return dataContent;
    }

    @Override
    public int compareTo(Data another) {
        // 按发送时间由后到先排序
        return another.getTime().compareTo(this.getTime());
    }
}
